#ifndef WEBWIDGET_H
#define WEBWIDGET_H

#include <QWidget>
#include <src/webengineview.h>
#include <QHBoxLayout>
#include <list>//改用list替代自己写的链表，减少代码量
using namespace std;
class WebWidget : public QWidget
{
    Q_OBJECT

public:
    struct WebPage{
        WebEngineView *page;
        int code;
    };
    explicit WebWidget(QWidget *parent = nullptr);
    ~WebWidget();
    list<WebPage*> PageList;//储存WebPage指针的容器
private:
    QHBoxLayout* layout;
signals:
public slots:
    WebPage* addpage(QUrl url);
    WebPage* addpage(WebEngineView*);
    bool ShowPage(WebPage*);
    void delPage(WebWidget::WebPage*);
    void delPage(int code);
    WebPage* page(int code);

};

#endif // WEBWIDGET_H
